{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "b3acce88-0480-4690-b2b6-ebfc4d808012",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[10, 20, 30, 40, 50, 60, 70, 80, 90]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = []\n",
    "for i in range(1, 10):\n",
    "    s.append(i * 10)\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "83cab954-1e9b-4927-a2d2-b1a0e037bf86",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "a9f40d47-6959-4132-bc2c-aa2476dc9990",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[10, 20, 30, 40, 50, 60, 70, 80, 90]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[10 * i for i in range(1, 10)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a690f8e3-8133-44ff-ab49-4646bf5cbf61",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "20e25405-3c3d-481a-97cf-8b98ef6874dc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[10, 30, 50, 70, 90]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[10*x for x in range(1, 10) if x % 2 == 1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "f35cda66-7a69-49c6-80a4-1bf87bce4980",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A 10\n",
      "B 20\n"
     ]
    }
   ],
   "source": [
    "for k, v in s:\n",
    "    print(k, v)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "94a1bb12-ddb1-4430-ae07-590a14aa53b2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'A': 10, 'B': 20}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = [('A', 10), ('B', 20)]\n",
    "\n",
    "{ k:v for k, v in s}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6bad6b0e-c64f-4f1d-b6b7-4d7524a65e18",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5e866319-bbd5-4447-bc2b-e7f4b7d4f6d1",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "afc91b30-a105-494d-87f1-6e2f7f3dab25",
   "metadata": {},
   "outputs": [],
   "source": [
    "names = ['A', 'B', 'C']\n",
    "values = [10, 20, 30]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "40c43365-5a84-422e-a38d-879089679982",
   "metadata": {},
   "outputs": [],
   "source": [
    "[('A', 10), ('B', 20), ('C', 30)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "5d7cce1b-f66e-4702-a237-cea8b91ac0da",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('A', 10)\n",
      "('B', 20)\n",
      "('C', 30)\n"
     ]
    }
   ],
   "source": [
    "for t in zip(names, values):\n",
    "    print(t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "eec8756f-2ed8-425b-a64f-c76ec81c2be2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('A', 10), ('B', 20), ('C', 30)]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[t for t in zip(names, values)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "fc85962e-7b69-4483-9dfc-c4827dbd0f77",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('A', 10), ('B', 20), ('C', 30)]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[ (k,v) for k, v in zip(names, values)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9d82ed8c-a4b9-4528-b106-5fe6aff07e37",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "f0825e9a-30a9-4879-b33c-f45919907f2a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'A': 10, 'B': 20, 'C': 30}"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "{ k:v for k, v in zip(names, values) }"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d26b56e9-1e19-47c0-94de-375f9c383f97",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "4ad0da24-3f02-4441-9814-2c0501708964",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0, 1, 2, 3, 4}"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "{x for x in range(5)}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fe298726-1e36-4659-9b2c-4974179246a9",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "cf31f880-9c50-4114-b721-850cab8f5348",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'name-A': 10, 'name-B': 20, 'name-C': 30}"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "{ f\"name-{k}\":v for k, v in zip(names, values) }"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9e4049d0-771a-45cd-a680-9aa7d6ea3fef",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
